package com.wqh.conformity.erupt.entity;

import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.annotation.sub_field.sub_edit.ChoiceType;
import xyz.erupt.annotation.sub_field.sub_edit.VL;
import xyz.erupt.jpa.model.BaseModel;

import javax.persistence.*;

/**
 *  @Erupt注解修饰在类上，@EruptField注解修饰在字段上
 *  其他注解均为Jpa注解
 *  @author wqh
 */
@DynamicUpdate
@DynamicInsert
@Data
@Erupt(name = "项目联系人")
@Table(name = "t_erupt_project_consignee")
@Entity
public class ProjectConsigneeEntity extends BaseModel {

    @EruptField(
            views = @View(title = "姓名"),
            edit = @Edit(title = "姓名"),
            sort = 4
    )
    private String name;


    @EruptField(
            views = @View(title = "身份证号"),
            edit = @Edit(title = "身份证号"),
            sort = 4
    )
    private String idCardNo;


    @EruptField(
            views = @View(title = "联系电话"),
            edit = @Edit(title = "联系电话"),
            sort = 4
    )
    private String phone;


    @EruptField(
            edit = @Edit(title = "状态", type = EditType.CHOICE,
                    choiceType = @ChoiceType(
                            vl = {
                                    @VL(label = "启用", value = "enable"),
                                    @VL(label = "禁用", value = "disable"),
                            }
                    ))
    )
    private String status;
}
